home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / web / spiderweb / patches / 006 < prev    next >
Encoding:
Text File  |  1989-07-19  |  3.3 KB  |  93 lines

  1. *** master/spider.web.old    Mon Jul  3 12:46:05 1989
  2. --- master/spider.web    Thu Jul 20 19:00:04 1989
  3. ***************
  4. *** 1532,1537 ****
  5. --- 1532,1541 ----
  6.   each scrap is true, the whole production will fire.
  7.   If we're called upon to make a scrap underlined or reserved, we'll add
  8.   to |trans[pos]|.
  9. + If a category is negated we add an extra clause to make
  10. + sure nothing matches the zero category, since {\tt WEAVE} assumes
  11. + no production ever matches a scrap with category zero.
  12.   #<Process a single category#>=
  13.       field[pos]=$i ## save this field to compare RHS
  14.       #<Set |negation|, and remove leading |"!"| from |$i| if necessary#>
  15. ***************
  16. *** 1540,1548 ****
  17.       cat = $i
  18.       categories[cat]=1 ## remember |cat| is a category
  19.       if (negation==0) {
  20. !         test[pos]=sprintf("(pp+%d)->cat==SP_%s",pos-1,cat)
  21.       } else {
  22. !         test[pos]=sprintf("(pp+%d)->cat!=SP_%s",pos-1,cat)
  23.       }
  24.       #<Update the record of the rightmost occurrence of category |cat|#>
  25.       #<Advance |pos|, making the new |trans[pos]| empty#>
  26. --- 1544,1553 ----
  27.       cat = $i
  28.       categories[cat]=1 ## remember |cat| is a category
  29.       if (negation==0) {
  30. !         test[pos]=sprintf("(pp+%d)->cat==SP_%s",pos-1,cat)
  31.       } else {
  32. !         test[pos]=sprintf("((pp+%d)->cat!=SP_%s && (pp+%d)->cat != 0)",\
  33. !             pos-1,cat,pos-1)
  34.       }
  35.       #<Update the record of the rightmost occurrence of category |cat|#>
  36.       #<Advance |pos|, making the new |trans[pos]| empty#>
  37. ***************
  38. *** 1551,1556 ****
  39. --- 1556,1565 ----
  40.   categories are separated by vertical bars.
  41.   We have to make the test for these things a disjunction, but
  42.   processing is more or less like the processing for a single category.
  43. + If a list of alternatives is negated we add an extra clause to make
  44. + sure nothing matches the zero category, since {\tt WEAVE} assumes
  45. + no production ever matches a scrap with category zero.
  46.   #<Process a list of alternative categories#>=
  47.       field[pos]=$i ## save this field to compare RHS
  48.       #<Set |negation|, and remove leading |"!"| from |$i| if necessary#>
  49. ***************
  50. *** 1557,1563 ****
  51.       if (negation==0) {
  52.           test[pos]="(" ## open for a list of good alternatives
  53.       } else {
  54. !         test[pos]="!(" ## open for a list of bad alternatives
  55.       }
  56.       #<Strip stars from |$i| (if any) and add appropriate
  57.           translations to |trans[pos]|#>
  58. --- 1566,1573 ----
  59.       if (negation==0) {
  60.           test[pos]="(" ## open for a list of good alternatives
  61.       } else {
  62. !         temp=sprintf("(pp+%d)->cat==0",pos-1)
  63. !         test[pos]="!(" temp "||" ## open for a list of bad alternatives
  64.       }
  65.       #<Strip stars from |$i| (if any) and add appropriate
  66.           translations to |trans[pos]|#>
  67. ***************
  68. *** 1635,1644 ****
  69.       #<Forget this production#>
  70.   }
  71.   
  72. ! # Wild cards are easy to process
  73.   #<Process a category wild card#>=
  74.       field[pos]=$i ## save this field to compare RHS
  75. !     test[pos]="(1)" ## anything matches
  76.       highwildcard=pos ## we don't really need this?
  77.       #<Advance |pos|, making the new |trans[pos]| empty#>
  78.   
  79. --- 1645,1655 ----
  80.       #<Forget this production#>
  81.   }
  82.   
  83. ! # Wild cards are easy to process, but we do have to remember that
  84. ! not even a wild card matches a scrap of category zero.
  85.   #<Process a category wild card#>=
  86.       field[pos]=$i ## save this field to compare RHS
  87. !         test[pos]=sprintf("(pp+%d)->cat!=0",pos-1) ## anything nonzero matches
  88.       highwildcard=pos ## we don't really need this?
  89.       #<Advance |pos|, making the new |trans[pos]| empty#>
  90.   
  91.